package 华为OD机试真题2023.基础题;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.*;

public class HJ23_任务总执行时长 {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner(new File("src/main/java/华为OD机试真题2023/基础题/input/23.txt"));
        String[] sArray = in.nextLine().split(",");
        int taskA = Integer.parseInt(sArray[0]);
        int taskB = Integer.parseInt(sArray[1]);
        int num = Integer.parseInt(sArray[2]);
        Set<Integer> res = new TreeSet<>();
        int countA = num;
        while (countA > 0) {
            int countB = num - countA;
            res.add(countA * taskA + countB * taskB);
            countA--;
        }
        res.add(num * taskB);
        System.out.println(Arrays.toString(res.toArray()));
    }
}
